All Questions
12 questions
-2votes
1answer
570views
How can I optimize C++ serialization? [closed]
I want to serialize a C++ class Ramdomclass . Below is the serialization function. ...
2votes
0answers
1kviews
A reuseable reconnecting TCP socket with Asio
I'm using (non-boost) Asio 1.18.1 and C++17. Forgive the boost tag, there wasn't a more specific one. I have a async_connect_with_retry composed asynchronous ...
2votes
3answers
381views
Fixed-size memory allocator
I've been trying to implement a simple Boost PMR allocator that has a fixed amount of memory. My first implementation (which can be found here) had undefined behavior and did not handle memory ...
0votes
1answer
41views
Simple runtime profiler for executable files
I'm sure there are several profilers written in C++ on here already, though with this one the goals are quite different. I attempted to make it as robust as possible, or 'fool-proof' if you will so ...
2votes
1answer
205views
"Structure of arrays" wrapper
I was looking into SOA to better utilize SIMD instructions. I implemented a generic wrapper object that lets you chose the amount of individual vectors each structure consists of. I am using xsimd and ...
6votes
1answer
110views
Fibonacci and Lucas sequence generator using Boost and GMP
I implemented this console application that generates Fibonacci and Lucas sequence numbers using boost and GMP for multiprecision. There is an iterator-like class which can do any sequence based on ...
3votes
0answers
431views
Calculate huge Fibonacci Numbers in C++ using GMP and boost::multiprecision
Problem Statement Calculate the exact value of the n-th Fibonacci number, say the one-billionth. Algorithm The algorithm is based on the idea that Fibonacci numbers can be represented as 2x2 ...
4votes
1answer
511views
Automatic Differentiation with C++ Header-Only Library
Code review/feedback is requested and appreciated for the following open-source automatic differentiation C++ header-only library released under the Boost License. I am the author. https://github.com/...
3votes
0answers
670views
C++17: Boost.Hana based compile-time plugin registration
My aim with the following is to have a way of registering a list of classes, which represent plugins. In the end, I want a boost::hana::set that contains type objects for all plugins' classes. I want ...
14votes
4answers
3kviews
FizzBuzz, ’17-style
My exercise is to write the Fizz Buzz problem with the following in mind: Use the latest up-to-date style and best practices for a C++17 compiler. Don’t just show that I can write a loop. Rather, ...
4votes
3answers
353views
Completed Makeshift Bash & Makefile To Compile C++ Examples
I am just experimenting with Bash and Makefiles to make my life easier, and here's what I came up with. Scenario: Files are in a directory containing a tutorial, or an iteration. For example, one ...
4votes
0answers
140views
Accept constructor arguments from a given subset of types
I found myself often in the position that I want to have multiple arguments in a constructor which could be in any order. For example: ...